home *** CD-ROM | disk | FTP | other *** search
/ Java Primer Plus / Java Primer Plus (Waite Group Proess)(1996).iso / chapter17 / students.java < prev    next >
Text File  |  1995-12-31  |  907b  |  33 lines

  1. class students {
  2.  
  3.   static public void main(String args[]) throws 
  4.                     DuplicateKeyException {
  5.  
  6.   BinaryTree theTree = new BinaryTree();
  7.  
  8.   simple_info aname = new simple_info(29,"Paul Tyma");
  9.   theTree.addnode(aname.key(),aname);
  10.   aname = new simple_info(11,"Gabriel Torok");
  11.   theTree.addnode(aname.key(),aname);
  12.   aname = new simple_info(78,"Billy Leach");
  13.   theTree.addnode(aname.key(),aname);
  14.   aname = new simple_info(77,"Patrick Doughty");
  15.   theTree.addnode(aname.key(),aname);
  16.   aname = new simple_info(87,"Troy Downing");
  17.   theTree.addnode(aname.key(),aname);
  18.   aname = new simple_info(23,"Yasha Dupa");
  19.   theTree.addnode(aname.key(),aname);
  20.  
  21.  
  22.       /* try out the new stuff */
  23.       aname = (simple_info)theTree.searchfor(11);
  24.       if (aname == null) System.out.println("not found");
  25.        else aname.printmyval();
  26.  
  27.       theTree.deleter(77);
  28.       theTree.deleter(29);
  29.  
  30.   }
  31.  }
  32.  
  33.